package com.meritdata.cloud.data.service.approval.repository;

import com.meritdata.cloud.data.service.approval.model.TdDownloadProposeRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.query.Param;

import java.util.Date;

public interface TdDownloadProposeRecordRepository extends JpaRepository<TdDownloadProposeRecord, Long>,
        QuerydslPredicateExecutor<TdDownloadProposeRecord> {

    @Modifying
    @Query(value = "insert into TdDownloadProposeRecord(proposerId,operator,operateType,text,operateTime) values(?1,?2,?3,?4,?5)",nativeQuery = true)
    void insertApprovalInfo(@Param("proposerId") long proposerId,
                            @Param("operator") String operator,
                            @Param("operateType") int operateType,
                            @Param("text") String text,
                            @Param("operateTime") Date operateTime);
}
